package com.situ.spring.proxy;

import org.junit.Test;

import com.situ.spring.service.IBanjiService;
import com.situ.spring.service.IStudentService;
import com.situ.spring.service.impl.BanjiServiceImpl;
import com.situ.spring.service.impl.StudentServiceImpl;

public class Clinet {

	public static void main(String[] args) {
//		DongShiZhang dongShiZhang = new DongShiZhang();
//		IQianZi qianZi = new MiShu(dongShiZhang);
//		qianZi.qianzi();
		
		// 目标对象
		IQianZi target = new DongShiZhang();
		// 给目标对象创建代理对象
		IQianZi proxy = (IQianZi) ProxyFactory.getProxyInstance(target);
		proxy.qianzi();
		
	}
	
	@Test
	public void test1() {
		IBanjiService banjiService = new BanjiServiceImpl();
		IBanjiService proxy = (IBanjiService) ProxyFactory.getProxyInstance(banjiService); 
		proxy.selectAll();
		proxy.deleteById();
	}
}
